package com.itheima.mySimpleDateFormat;

import java.util.Date;

public class Test1 {
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println("date = " + date);

        long time = date.getTime();
        System.out.println("time = " + time);

        Date date1 = new Date(time);
        System.out.println("date1 = " + date1);

        long time1 = time - (1000L * 60 * 60 * 24 * 30);
        date.setTime(time1);

        Date date2 = new Date(time1);
        System.out.println("date2 = " + date2);


        Date date3 = new Date(1000L * 60 * 60 * 24 * 30);
        System.out.println("date2 = " + date3);


        System.out.println("date = " + date);
    }
}
